package org.xiyu.yee.pjwto;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.loader.api.FabricLoader;
import org.xiyu.yee.pjwto.config.PiglinTradeConfig;
import org.xiyu.yee.pjwto.event.FabricServerEvents;

public class Pjwto implements ModInitializer {

    @Override
    public void onInitialize() {

        // This method is invoked by the Fabric mod loader when it is ready
        // to load your mod. You can access Fabric and Common code in this
        // project.

        // Use Fabric to bootstrap the Common mod.
        Constants.LOG.info("Hello Fabric world!");
        CommonClass.init();
        
        // 加载配置文件
        PiglinTradeConfig.loadConfig(FabricLoader.getInstance().getConfigDir().toFile());
        
        // 注册服务器启动事件
        FabricServerEvents.register();
    }
}
